package com.education.realtime.util;

import com.education.realtime.common.Constant;

public class SqlUtil {
    public static String getKafkaReadDDL(String topic, String groupId) {
        return "with(  " +
                "  'connector' = 'kafka',  " +
                "  'topic' = '" + topic + "',  " +
                "  'properties.bootstrap.servers' = ' " + Constant.KAFKA_BROKERS +  "',  " +
                "  'properties.group.id' = ' " + groupId +  "',  " +
                "  'scan.startup.mode' = 'latest-offset',  " +
                "  'format' = 'json'  " +
                ")";
    }

    public static String getKafkaWriteDDL(String topic) {
        return " WITH (\n" +
                "  'connector' = 'kafka',\n" +
                "  'topic' = '" + topic + "',\n" +
                "  'properties.bootstrap.servers' = '" + Constant.KAFKA_BROKERS + "',\n" +
                "  'format' = 'json'\n" +
                ")";
    }
}
